# Contributor: Marvin Preuss <marvin@xsteadfastx.org>
# Maintainer: Marvin Preuss <marvin@xsteadfastx.org>
pkgname=viddy
pkgver=0.4.0
pkgrel=5
pkgdesc="Modern watch command. Time machine and pager etc."
url="https://github.com/sachaos/viddy"
arch="all"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/sachaos/viddy/archive/refs/tags/v$pkgver.tar.gz
	update-go-mod.patch
	"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -ldflags "-X main.version=$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/"$pkgname"
}

sha512sums="
5e0fdbc1b1fe441a4190bf13d3331eeebbba0a6be6b965bd3f22fe7ed2cfa303fe54d886992bc38d1c267d3013bb3a603fe32825659b472c985d8f72dbf39cf6  viddy-0.4.0.tar.gz
7527b8cb38e09af74e2da792c185eaddf5b318a9173c4827bc0d5ef358b2a2f7e88c8cae388e7c883aec308e8dc24a7eeea0bc46f5a06d7e5107d3b70c7f79fa  update-go-mod.patch
"
